package com.itheima.service.serviceImpl;

import com.itheima.dao.UserDao;
import com.itheima.dao.daoImpl.UserDaoImpl;
import com.itheima.domain.User;
import com.itheima.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    private UserDao dao = new UserDaoImpl();
    @Override
    public List<User> findAll() {

        return dao.findAll();
    }

    @Override
    public void addUser(User user) {
        dao.addUser(user);
    }

    @Override
    public void deleteById(String id) {
        dao.deleteById(id);
    }

    @Override
    public User findById(String id) {
        User user = dao.findById(id);
        return user;
    }

    @Override
    public void updateUser(User user) {
        dao.updateUser(user);
    }
}
